//
// Tool for selecting the entities that are part of the animation
//

TOOL.Category = "Motion Tracker"
TOOL.Name = "Scene Entities"
TOOL.Command = nil
TOOL.ConfigName = ""

if CLIENT then
	language.Add( "Tool_ganimator_scene_name", "Scene Entities" )
	language.Add( "Tool_ganimator_scene_desc", "Manage the entities you want to record" )
	language.Add( "Tool_ganimator_scene_0", "Left Click: Enable animation for entity      Right Click: Disable animation for entity" )
end

function TOOL:LeftClick( tr )
	local ent = tr.Entity
	if ent and ent:IsValid() and ent:GetClass() == "prop_physics" and !ent:GetNWBool( "GAAnimated", false ) then
		if SERVER then
			ent:SetNWBool( "GAAnimated", true )
			ent:SetColor( 255, 0, 0, 255 )
		else
			return true
		end
	end
end

function TOOL:RightClick( tr )
	local ent = tr.Entity
	if ent and ent:IsValid() and ent:GetClass() == "prop_physics" and ent:GetNWBool( "GAAnimated", false ) then
		if SERVER then
			ent:SetNWBool( "GAAnimated", false )
			ent:SetColor( 255, 255, 255, 255 )
		else
			return true
		end
	end
end